package com.keur.money.config

import com.keur.money.app.MyApp
import com.keur.money.utils.helper.SharedHelper
import com.keur.money.utils.language.LocaleContract
import com.keur.money.utils.language.MultiLanguages


/**
 * MullaFlow
 * @Author wwdeng
 * @CreateTime: 2024/7/4 19:25
 * @Annotation：APP 配置文件
 */
object KeurConfigs {

    /**
     * APP 名称
     */
    const val KEUR_APPNAME = "KEURMONEY"

    /**
     * 包名
     */
    const val KEUR_PACKAGENANME = "com.keurmoney.safeapp.onlineloan"

    /**
     * 隐私协议
     */
    const val KEUR_PRIVACY_POLICY_LINK = "https://sites.google.com/vistafinance.net/keur-money"

    /**
     * 加解密
     */
    const val KEUR_AES_KEY = ""
    const val KEUR_AES_IV = ""

    /**
     * Adjust
     */
    const val KEUR_ADJ_TOKEN = "ct9tbk9xmpz4"

    /**
     * 是否是法语地区
     *  desc：地区转发（timeZone） 以 fcfa、xaf、senegal、benin 结尾，则定义为法语地区
     */
    fun isFrench(): Boolean{
        val timeZone = SharedHelper.getKeurSPString(SharedHelper.KEUR_SPKEY.KEUR_TIMEZONE)
        return timeZone.endsWith("fcfa") || timeZone.endsWith("xaf") || timeZone.endsWith("senegal") || timeZone.endsWith("benin")
    }

    /**
     * 加纳 233
     */
    fun isGha(): Boolean{
        val timeZone = SharedHelper.getKeurSPString(SharedHelper.KEUR_SPKEY.KEUR_TIMEZONE)
        return timeZone.endsWith("gha")
    }

    /**
     * 肯尼亚 254
     */
    fun isKsh(): Boolean{
        val timeZone = SharedHelper.getKeurSPString(SharedHelper.KEUR_SPKEY.KEUR_TIMEZONE)
        return timeZone.endsWith("ksh")
    }

    /**
     * 乌干达 256
     */
    fun isUgx(): Boolean{
        val timeZone = SharedHelper.getKeurSPString(SharedHelper.KEUR_SPKEY.KEUR_TIMEZONE)
        return timeZone.endsWith("ugx")
    }

    /**
     * 科特迪瓦 225
     */
    fun isFcfa(): Boolean{
        val timeZone = SharedHelper.getKeurSPString(SharedHelper.KEUR_SPKEY.KEUR_TIMEZONE)
        return timeZone.endsWith("fcfa")
    }

    /**
     * 喀麦隆  237
     */
    fun isXaf(): Boolean{
        val timeZone = SharedHelper.getKeurSPString(SharedHelper.KEUR_SPKEY.KEUR_TIMEZONE)
        return timeZone.endsWith("xaf")
    }

    /**
     * 赞比亚 	260
     */
    fun isZmb(): Boolean{
        val timeZone = SharedHelper.getKeurSPString(SharedHelper.KEUR_SPKEY.KEUR_TIMEZONE)
        return timeZone.endsWith("zmb")
    }

    /**
     * 塞内加尔  221
     */
    fun isSenegal(): Boolean{
        val timeZone = SharedHelper.getKeurSPString(SharedHelper.KEUR_SPKEY.KEUR_TIMEZONE)
        return timeZone.endsWith("senegal")
    }

    /**
     * 坦桑尼亚  255
     */
    fun isTanz(): Boolean{
        val timeZone = SharedHelper.getKeurSPString(SharedHelper.KEUR_SPKEY.KEUR_TIMEZONE)
        return timeZone.endsWith("tanz")
    }

    /**
     * 贝宁  229
     */
    fun isBenin(): Boolean{
        val timeZone = SharedHelper.getKeurSPString(SharedHelper.KEUR_SPKEY.KEUR_TIMEZONE)
        return timeZone.endsWith("benin")
    }

    /**
     * 是否是斯瓦西里语
     */
    fun isSwahili(): Boolean{
        if (isTanz()) {
            val curtLocale = MultiLanguages.getAppLanguage(MyApp.app.getAppContext())
            when (curtLocale.language) {
                LocaleContract.getSwahiliLocale().language -> {//坦桑
                    return true
                }
            }
        }
        return false
    }
}